//
//  NSString+FloatString.m
//  TenMinDemo
//
//  Created by Shawn Li on 2021/3/16.
//  Copyright © 2021 CYXiang. All rights reserved.
//

#import "NSString+FloatString.h"

@implementation NSString (FloatString)

- (NSString *)floatString;
{
    //直接传入精度丢失有问题的Double类型
    double conversionValue = [self doubleValue];
    NSString *doubleString = [NSString stringWithFormat:@"%lf", conversionValue];
    NSDecimalNumber *decNumber = [NSDecimalNumber decimalNumberWithString:doubleString];
    return [decNumber stringValue];
}
@end
